|MadSci Network: Physics|
The ability for any particular material to absorb or reflect light of a particular wavelength depends on the structure of the material at the molecular level. In general, clothes that are white will reflect light pretty well at most wavelengths in and around the visible spectrum, including infrared and ultraviolet and, in general, clothes that are black will absorb it. The reason I say "in general" is because it applies to most materials, but some materials will behave one way in visible light and differently in IR/UV. One way to tell if a particular piece of material will reflect UV light is to put it under a "black light" and see if it looks bright or dark. Brightness indicates that it is reflecting the UV, darkness indicates it is absorbing it.
From a safety standpoint, either white or black (or any color) will protect you from UV, because UV light does not penetrate through solid materials, although materials that absorb light will be more uncomfortable due to the warming that occurs. However, your point about density is a very good one. If you have a material that is loosely woven, then there are holes that will allow the UV (and all light) to penetrate to your skin. A low density material (one with a lot of holes) could cause you to sunburn - and I have had this very thing happen to me.
Try the links in the MadSci Library for more information on Physics.