Optimum and equilibrium in a transport problem with queue effects