A single ion as a nanoscopic probe of an optical field