Israel, Hamas agree to Gaza cease-fire