Numerical computation is achieved in an axisymmetric configuration to analyze the magnetic field effect on thermosolutal convection during vertical solidification of a binary alloy. The bath is exposed to a uniform temperature profile in unsteady state. During the growth three regions appear: liquid, mushy and solid zones. The mushy zone is assimilated to porous medium. A mathematical model of heat, momentum and solute transfer has been developed in primitive variables (pressure-velocity). A single domain approach (enthalpy method) is used to build the equations system. In this context, a computer code has been developed and validated with previous studies. The results in term of stream function and solute concentration show the strong effect of the magnetic field on the fluid flow and on the solutal stratification. The effects of magnetic field and melt convection intensity were demonstrated. The main results show that the quality of highly doped binary alloy crystals can be improved when the growth process occurs at low pulling rates and under a magnetic field.