sunburn - what causes it?

Is it the ultra violet light that actually burns you or the infra red(heat)? I thought it was the ultra violet but my mate reckons the UV just causes skin cancer.

Every source I’ve seen says UV rays. UVA rays can cause melanoma; UVB rays cause sunburn.

http://www.healthatoz.com/healthatoz/Atoz/ency/sunburn.html