We define a minimal model of traffic flows in complex networks containing the most relevant features of real routing schemes, i.e. a trade--off strategy between topological-based and traffic-based routing. The resulting collective behavior, obtained analytically for the ensemble of uncorrelated networks, is physically very rich and reproduces results recently observed in traffic simulations on scale-free networks. We find that traffic control is useless in homogeneous graphs but may improves global performance in inhomogeneous networks, enlarging the free-flow region in parameter space. Traffic control also introduces non-linear effects and, beyond a critical strength, may trigger the appearance of a congested phase in a discontinuous manner.