Hamas has agreed to release an American-Israeli hostage and the bodies of four others, as talks continue to broker the next stage of the ceasefire with Israel.