A search for exotic decays of the Higgs boson into a pair of spin-zero particles, H -> aa, where the a-boson decays into b-quarks promptly or with a mean proper lifetime c tau(a) up to 6 mm and has a mass in the range of 20-60GeV, is presented. The search is performed in events where the Higgs boson is produced in association with a W or Z boson, giving rise to a signature of one or two charged leptons (electrons or muons) and multiple jets from b-quark decays. The analysis is based on the dataset of proton-proton collisions at root s = 13TeV recorded in 2015 and 2016 by the ATLAS detector at the CERN Large Hadron Collider, corresponding to an integrated luminosity of 36: 1 fb(-1). No significant excess of events above the Standard Model background prediction is observed, and 95% confidence-level upper limits are derived for the production cross-sections for pp -> WH, ZH and their combination, times the branching ratio of the decay chain H -> aa -> 4b. For a-bosons which decay promptly, the upper limit on the combination of cross-sections for WH and ZH times the branching ratio of H -> aa -> 4b ranges from 3.0 pb for m(a) = 20 GeV to 1.3 pb for m(a) = 60 GeV, assuming that the ratio of WH to ZH cros-ssections follows the Standard Model prediction. For a-bosons with longer proper lifetimes, the most stringent limits are 1.8 pb and 0.68 pb, respectively, at c tau(a) similar to 0.4 mm.