Regularity for the wave equation with a critical nonlinearity