A far-ultraviolet variable with an 18-minute period in the globular cluster NGC 1851