Sunlight is classified as a group 1 carcinogen. Also included in that group are things like asbestos.
By the way, all you can know from this fact is that sunlight exposure poses non-zero risks of disease contraction – it does not mean that exposure to sunlight is going to cause the same or as damaging a cancer as exposure to asbestos. That said, we all seem pretty comfortable not only taking appropriate and sensible precautions when encountering sunlight (such as hiking with a long sleeve shirt, wearing sunscreen, or living in Rochester), and we seem to be able to manage our exposure to sun without the force of law. Most important of course is that we are all pretty well educated that sunlight can indeed cause cancer yet nonetheless we happily seek it out because we understand in moderation exposure to sunlight can be helpful (it is a disinfectant, we absorb valuable nutrients from it) but that even when we know we are absorbing it in doses that are probably not healthful, we appreciate that it provides considerable benefits, even if they are only aesthetic.
What would be fun is to see a list of known carcinogens not by the “group” they are in, but rather the likely risks of contracting cancer and reduction in quality adjusted life years from typical exposures. How does sunlight rank? Exposure to various known pesticides and herbicides? And more.