It can also be used for producing some vertical lift if it is canted up; however, it would not exist if they didn't need anti-torque. So yes, its primary reason for having a tail rotor is anti-torque. It also provides yaw control in hover. But again this is a fall out of needing anti-torque.
Mike
MD