We consider the counterpropagating interaction of a signal and a pump beam in a spun fiber and in a randomly birefringent fiber, the latter being relevant to optical telecommunication systems. On the basis of a geometrical analysis of the Hamiltonian singularities of the system, we provide a complete understanding of the phenomenon of polarization attraction in these two systems, which allows to achieve a control of the polarization state of the signal beam by adjusting the polarization of the pump. In spun fibers, all polarization states of the signal beam are attracted toward a specific line of polarization states on the Poincare sphere, whose characteristics are determined by the polarization state of the injected backward pump. In randomly birefringent telecommunication fibers, we show that an unpolarized signal beam can be repolarized into any particular polarization state, without loss of energy. (C) 2011 Optical Society of America