The epoch of cosmic heating by early sources of X-rays