Gradient theory for plasticity via homogenization of discrete dislocations