Correlation between magnetic and electronic properties of the perovskite HoBaCo2O5