Measurement of the large-scale anisotropy of cosmic rays in the PAMELA experiment