Numerical simulation of convective three-dimensional flows in a horizontal cylinder under the action of a constant magnetic field