Weakly nonlinear Marangoni instability in the presence of a magnetic field: effect of the boundary conditions and magnetic Prandtl number