On a Relation Between the Rate-Distortion Function and Optimal Transport