Sudan's military council and protesters have reached an agreement which will start a new period of transitional government.