Spatially resolved electronic structure inside and outside the vortex cores of a high-temperature superconductor