President Joseph Kabila has agreed to step down after elections next year in a power-transfer deal backed by the church.