Barclays has apologised to customers after technical problems caused disruption to services and payments for several hours.