Electronic structure of La-Cu and Y-Ba-Cu oxides: ground-state properties and photoemission spectra