Trees on networks: resolving statistical patterns of phylogenetic similarities among interacting proteins