Physical conditions in nearby active galaxies correlated with ultra-high-energy cosmic rays detected by the Pierre Auger Observatory