Snakes utilize irregularities in the terrain, such as rocks and vegetation, for faster and more efficient locomotion. This motivates the development of snake robots that actively use the terrain for locomotion, i.e., obstacle-aided locomotion. In order to accurately model and understand this phenomenon, this paper presents a novel nonsmooth (hybrid) mathematical model for wheel-less snake robots, which allows the snake robot to push against external obstacles apart from a flat ground. The framework of nonsmooth dynamics and convex analysis allows us to systematically and accurately incorporate both unilateral contact forces (from the obstacles) and isotropic friction forces based on Coulomb's law using set-valued force laws. The mathematical model is verified through experiments. In particular, a back-to-back comparison between numerical simulations and experimental results is presented. It is, furthermore, shown that the snake robot is able to move forward faster and more robustly by exploiting obstacles.