UK will work with Egypt's new rulers, says William Hague