Israel and Hamas have agreed to the first phase of the Gaza peace plan brokered by US President Donald Trump.