Study of B→πlν and B→ρlν decays and determination of |Vub|