We present a molecular-level study of the geometric and electronic properties of Co(II) tetraphenylporphyrin molecules adsorbed on the Cu(111) surface. A combination of low-temperature scanning tunneling microscopy and near-edge X-ray absorption fine structure observations reveals how the metal substrate induces a conformational adaptation into a distorted saddle-shaped geometry. By scanning tunneling spectroscopy we identified the discrete energy levels of the molecule and mapped their spatial electron-density distributions. These results, along with a simple theoretical description, provide a direct correlation between the shape of frontier molecular orbitals and intramolecular structural features.