Measurement of the inclusive electron spectrum from B meson decays and determination of |Vub|