Growing black holes: Accretion in a cosmological context