No Stock is an Island: Learning Internal and Relational Attributes of Stocks with Contrastive Learning