In Romans 2:13 St. Paul says "for not the hearers of the law are just in the sight of God, but the doers of the law will be justified..."
However, in Galatians 2:16 he says "knowing that a man is not justified by the works of the law but by faith in Jesus Christ, even we have believed in Christ Jesus, that we might be justified by faith in Christ and not by the works of the law; for by the works of the law no flesh shall be justified."
So is there a contradiction here? No.
A doer of the Law is one who actually fulfills the law. But the Law, and the "works of the Law" are not the same thing. St. Paul uses the phrase "the works of the law" only once in Romans, and four times in Galatians.
That St. Paul makes a distinction between the Law and "the works of the Law" is made clear in Romans 9:31f:
"Israel, pursuing the law of righteousness, has not attained to the law of righteousness. Why? Because they did not seek it by faith, but as it were, by the works of the law."
Obviously the Law of righteousness is something to attain to, and the works of the law are a means... and a means incapable of attaining the end.
But what do the Fathers say? Again we see the distinction between the moral and ceremonial law of the Old Testament, and they also emphasize the need for faith:
"Some say that if Paul is right in asserting that no one is justified by the works of the law but from faith in Christ, the patriarchs and prophets and saints who lived before Christ were imperfect. We should tell such people that those who are said not to have obtained righteousness are those who believe that they can be justified by works alone. The saints who lived long ago, however, were justified from faith in Christ, seeing that Abraham saw in advance Christ's day." - St. Jerome, Commentary on Galatians 2:16, Migne PL 26:343C-D, (quoted in the Ancient Christian Commentary on Scripture: New Testament, Vol. VIII, p. 30, emphasis added)
"The necessary commandments of the law were taught even by nature. That is, "You shall not commit adultery, you shall not murder, you shall not steal, you shall not bear false witness against thy neighbor, honor your father and mother, and the rest of this kind." But the commandments about the sabbath and circumcision and lepers and menstruation and sacrifice were peculiar to the [Jewish] law, since nature taught nothing about these matters. These are what he now calls works of the law. The transgression of these is sin, yet the mere keeping of them is not the way of maintaining perfect righteousness. For these were symbols of other things. Nonetheless they were appropriate to the Jews in their due time. -Blessed Theodoret, Commentary on Galatians 2:15-16 (ACCS, NT, V. VIII, p. 31)
"Here he begins to demonstrate in what sense the grace of faith is sufficient for justification without the works of the law.... But so that this question may be carefully treated and no one may be deceived by ambiguities, we must first understand that the works of the law are twofold; for they reside partly in ceremonial ordinances and partly in morals. To the ordinances belong the circumcision of the flesh, the weekly sabbath, new moons, sacrifices and all the innumerable observances of this kind. But to morality belong "You shall not kill, you shall not commit adultery, you shall not bear false witness" and so on. Could the apostle possibly not care whether a Christian were a murderer and adulterer or chaste and innocent, in the way that he does not care whether he is circumcised or uncircumcised in the flesh? He therefore is specially concerned with the works that consist in ceremonial ordinances, although he indicates that the others are sometimes bound up with them. But near the end of the letter he deals separately with those works that consist in morals, and he does this briefly, but he speaks at greater length regarding the [ceremonial] works... For nothing so terrifies the mind as a ceremonial ordinance that is not understood. But when it is understood it produces spiritual joy and is celebrated gladly and in due season. It is read and treated only with a spiritual sweetness. Now every sacrament, once understood in this way, is applied either to the contemplation of truth or to good morals. The contemplation of truth is found in the love of God alone, good morals in the love of God and the neighbor, and on these two precepts depend the whole Law and the Prophets." -St. Augustine, Commentary on Galatians 3:2, Migne PL 35:2117, (ACCS, NT, V. VIII, p. 36, emphasis added).
What St. Paul means by the "works of the Law" is the attempt to be justified by works, and in particular by the ceremonial law of the Old Testament, and his point is that we are not saved by works alone, our works must be joined to faith, and that the ceremonial law of the Old Testament is not obligatory for New Testament believers. He does not for one moment suggest that the Moral Law is optional, or that one may violate it with indifference and expect to be saved. Christ said, "If you love Me, keep My commandments" (John 14:15). And St. John said "He who says, “I know Him,” and does not keep His commandments, is a liar, and the truth is not in him" (1 John 2:4).