Unveiling the nature of INTEGRAL objects through optical spectroscopy. VII. Identification of 20 Galactic and extragalactic hard X-ray sources