Masses of heavy tetraquarks in the relativistic quark model