Analysis of surface- and bulk-plasmon contributions to x-ray photoemission spectra