I think it serves a few purposes.
One is for heat absorption, especially if the squirrel is young and the rock is warm. We learned this when we found a young squirrel splayed out like that on our driveway in the sun. It was a hot day and we thought he (or she) would burn on the driveway, but as it turned out, he was probably looking for the heat.
Squirrels maintain about the same core temperature as we do during the day—around 99°F (37°C), but they can cool off to 95°F (35°C) degrees at night. Source.
According to that same source, they can tolerate heat as high as 108°F (42°C), using other mechanisms, including certain tail movements, to cool down when necessary.
Even when they're old enough to live on their own, for a period of weeks the mother still spends some time with them and shares her body heat. If they become separated from her, or are still acclimating, they may actively seek out a source to raise their body temperature. That's what we were told when we brought ours to the Wildlife Clinic of the Cummings Veterinary Medical Center, a world-renowned leader in the field of wildlife research and care.
Because we, and they, were concerned for his safety, we left him overnight so they could run tests, but they said he was totally healthy. They told us to bring him back to the area where we had found him. Either his mom would find him, or, if he was in the process of figuring out how to live outside the nest, he'd probably be fine.
We followed the instructions and he stayed in our yard for two years, after which we moved away.