UV is a spectrum. UV-B is responsible for vitamin D production. Very little UV-B reaches us, even during the summer in the northern hemisphere. UV-A does damage, and reaches us much more strongly. You can receive damaging UV exposure while producing little to no vitamin D.
https://en.wikipedia.org/wiki/Ultraviolet#/media/File:Ozone_...