Uber is leaving Nigeria and Uganda, ending its ride-hailing services in the two African markets with immediate effect.