Stability of the Hayward black hole under electromagnetic perturbations