Cosmic microwave background constraints on the epoch of reionization