Whodunit? Learning to Contrast for Authorship Attribution