Spain's Socialists and hard-left Sumar party reach coalition agreement