A deal between Israel and Hamas to release hostages and begin a ceasefire was officially signed by representatives in Doha