Dimensional reduction and catalysis of dynamical symmetry breaking by a magnetic field