Formation of a magnetic hysteresis loop with respect to a bias voltage is investigated theoretically in a spin-valve device based on a single magnetic molecule. We consider a device consisting of two ferromagnetic electrodes bridged by a carbon nanotube, acting as a quantum dot, to which a spin-anisotropic molecule is exchange-coupled. Such a coupling allows for transfer of angular momentum between the molecule and a spin current flowing through the dot, and thus, for switching orientation of the molecular spin. We demonstrate that this current-induced switching process exhibits a hysteretic behavior with respect to a bias voltage applied to the device. The analysis is carried out with the use of the real-time diagrammatic technique in the lowest-order expansion of the tunnel coupling of the dot to electrodes. The influence of both the intrinsic properties of the spin-valve device (the spin polarization of electrodes and the coupling strength of the molecule to the dot) and those of the molecule itself (magnetic anisotropy and spin relaxation) on the size of the magnetic hysteresis loop is discussed.