Tonic contains the bitter compound quinine. Quinine has the special property that it emits white-bluish light under the UV-lights often used in discos (similar to some fabrics).
Tonic contains up to 85 mg/l of quinine and was initially added as an anti-malaria compound. At present it is only added for the bitter taste. Quinine is obtained from the bark of a South America tree and it is quite expensive. Hence, nowadays quinine is often replaced by bitter compounds from chicory roots. These do not emit light under UV lamps.