Robert Mugabe's ruling party has agreed to a power-sharing deal with opposition leader Morgan Tsvangirai.