Quantum fields in a big-crunch–big-bang spacetime