The signing came hours after Israel and Hamas exchanged hostages and prisoners.