The production of beauty quarks in ep interactions has been studied with the ZEUS detector at HERA for exchanged four-momentum squared Q2 > 10 GeV2, 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 <peT <8 GeV and pseudorapidity |ηe| <1.5. Cross sections for beauty production were measured and compared with next-to-leadingorder QCD calculations. The beauty contribution to the proton structure function F2 was extracted from the doubledifferential cross section as a function of Bjorken-x and Q2.