We study the behaviour of the magnetization in a half-metallic ferromagnet/nonmagnetic insulator/ferromagnetic metal/paramagnetic metal (FM1/NI/FM2/PM) tunnel junction. It is calculated self-consistently within the nonequilibrium Keldysh formalism. The magnetic regions are treated as band ferromagnets and are described by the single-band Hubbard model. We developed a nonequilibrium spectral density approach to solve the Hubbard model approximately in the switching magnet. By applying a voltage to the junction it is possible to switch between antiparallel (AP) and parallel (P) alignment of the magnetizations of the two ferromagnets. The transition from AP to P occurs for positive voltages while the inverse transition from P to AP can be induced by negative voltages only. This behaviour is in agreement with the Slonczewski model of current-induced switching and appears self-consistently within the model, i.e. without using half-classical methods like the Landau-Lifshitz-Gilbert equation.