Israel, Palestinians agree to Gaza ceasefire