Contribution of collective excitations to the surface energy of metals