Hysteretic jumps in the response of layered superconductors to electromagnetic fields