Looks like a flatworm. Clear ones are alright, it's the red ones you have to watch out for. If you have any wrasses they should keep the population in check. If not, and you have the space, there are a number of beautiful reef-safe wrasses that will take care of them for you.
Also, I notice the population tends to increase in my sump if I slack on the water changes. If you're having water quality issues (possibly indicated by the green algae on the rock in the background), taking care of those issues may resolve the flatworm problem as well.