A self-portrait by Andy Warhol has sold for a record $32.5 million (£21.6 million) in New York.