Time-periodic heating of Rayleigh–Benard convection in a vertical magnetic field