Because UV rays react so strongly with most elements, they do not penetrate very far. In fact, none of the UV rays can get to the astronaut'sbody surface because of his spacesuit and helmet. The same is true on the Earths surface, you can avoid sunburn if you wear clothes and a good hat, though scattered UV light that bounces off the ground can also cause a burn (especially on sunny days with snow on the ground.). Astronauts are more worried about xrays and charged particles in space that can penetrate their suits.
John Vallerga