Nonanomalous R-symmetry in supersymmetric unified theories of quarks and leptons