The UK’s threat to recognise a Palestinian state if Israel does not agree to a ceasefire in Gaza has drawn criticism.