Hohenberg--Kohn theorem for nonlocal external potentials