Hamas 'in contact' with EU and US