Optimal urban networks via mass transportation