EU agrees windfall tax on energy firms