The production of beauty quarks in ep interactions has been studied with the ZEUS detector at HERA for exchanged four-momentum squared Q^2 > 10 GeV^2, using an integrated luminosity of 363 pb^{-1}. The beauty events were identified using electrons from semileptonic b decays with a transverse momentum 0.9 < p_T^e < 8 GeV and pseudorapidity |eta^e| < 1.5. Cross sections for beauty production were measured and compared with next-to-leading-order QCD calculations. The beauty contribution to the proton structure function F_2 was extracted from the double-differential cross section as a function of Bjorken-x and Q^2.