Rivals sign power-sharing deal