Damped Lyman α systems in galaxy formation simulations