Study of B -> pi l nu and B -> rho l nu decays and determination of |Vub|