How the first generations of luminous baryons established the X-ray and UV backgrounds