Labour prime minister said Israel had right ‘to defend itself’ from attacks, including from Iran