Parallel retrieval of correlated patterns: from Hopfield networks to Boltzmann machines