Sudan’s military, civilian factions sign deal seeking to end crisis