A search is presented for production of dark-matter particles recoiling against a leptonically decaying Z boson in 20.3fb-1 of pp collisions at s=8TeV with the ATLAS detector at the Large Hadron Collider. Events with large missing transverse momentum and two oppositely charged electrons or muons consistent with the decay of a Z boson are analyzed. No excess above the Standard Model prediction is observed. Limits are set on the mass scale of the contact interaction as a function of the dark-matter particle mass using an effective field theory description of the interaction of dark matter with quarks or with Z bosons. Limits are also set on the coupling and mediator mass of a model in which the interaction is mediated by a scalar particle.