While you’re actually surfing, there’s not much you can do besides making sure you’re covered up in top-rated sunscreen for surfing.
Still, you can consider using a beach umbrella while you take breaks from surfing, for the extra UV protection. Sun hats are also a good idea when you’re not really on the surfboard.