Rank two quadratic pairs and surface group representations