In the paper, a backlash compensator is proposed for accurate position control of the needle manipulator for the magnetic resonance imaging (MRI) guided biopsy. Having long cable driven transmission, the robot guarantees the MR-compatibility, but has accuracy degradation due to the backlash problem. To handle the problem, a backlash compensator is proposed based on the Prandtl-Ishlinskii model, regarding the continuity of the control input. The particle swarm optimization is used to identify the backlash model. Through the experiments, it is verified that the proposed compensator can reduce the tracking error dramatically, and can provide adequate accuracy for the biopsy operation.