Learning to Make Analogies by Contrasting Abstract Relational Structure