Contrastive Learning of Structured World Models