You need to lay out during solar noon in the summer. In your 20s you can produce about 1k IU per minute for full body exposure, however, that goes down with age.
The sun's zenith has to be 45 degrees or higher in the sky for you to produce Vitamin D. A small spectrum of UVB (285 to 315 nm) is responsible for the subcutaneous photochemical synthesis of cholecalciferol, an important hormone of the endocrine system that we know as Vitamin D. Thus you want to avoid morning sun and late afternoon sun, and forget about it during the winter. So if your shadow is great than you are tall, avoid the sun.
You can google the time for solar noon in your local area. For example, in San Francisco, solar noon in for September 15th is 1:05 pm at which time the sun's zenith will only be 55 degrees. My runs in shorts and no shirt is soon coming to end for this season.
http://www.timeanddate.com/worldclock/astronomy.html?n=224
Regarding the 'damned if you do, damned if you don't' situation, don't worry about it. Melanoma is an office worker's disease, people who vocationally work outside have a higher risk of melanoma. Huh? Lower Vitamin D levels increases your risk of melanoma. Go figure, and sun screen block UVB, not UVA. So the rise in skin cancer might be due to increase in the use of sun screen, not sun exposure per se. More people get skin cancer, the more shrill the dermatologist become about using sun screen, and so the cat bites itself in the tail. More on that here:
Skin Cancer/Sunscreen - the Dilemma
http://www.youtube.com/watch?v=eeXtGHSt-5o&feature=share...
My youtube playlist on Vitamin D:
http://www.youtube.com/playlist?list=PL997D20130A1069B8