When it comes to St. Paul's theological arguments, we must be careful to take into consideration the larger context. To that end, let's expand the passage range a little:
Ephesians 1-10 (DRB) (emphasis and italics mine)
1 And you, when you were dead in your offences, and sins, 2 Wherein in time past you walked according to the course of this world, according to the prince of the power of this air, of the spirit that now worketh on the children of unbelief: 3 In which also we all conversed in time past, in the desires of our flesh, fulfilling the will of the flesh and of our thoughts, and were by nature children of wrath, even as the rest: 4 But God, (who is rich in mercy,) for his exceeding charity wherewith he loved us, 5 Even when we were dead in sins, hath quickened us together in Christ, (by whose grace you are saved,) 6 And hath raised us up together, and hath made us sit together in the heavenly places, through Christ Jesus. 7 That he might shew in the ages to come the abundant riches of his grace, in his bounty towards us in Christ Jesus. 8 For by grace you are saved through faith, and that not of yourselves, for it is the gift of God; 9 Not of works, that no man may glory. 10 For we are his workmanship, created in Christ Jesus in good works, which God hath prepared that we should walk in them.
St. Paul's point is clear: it can't have been by works that you were saved, because we were all by nature children of wrath, slave to our sinful inclinations. (He makes a similar point with regard to Abraham, and how he was considered just even before he was circumcised). That is, assent to the faith itself is an 'endo-salvific' deal (God enables it, you simply recieve it, use it, keep it).
It is in this sense, then, that St. Paul writes about continuing in doing good unto eternal life: that those who persevere with the grace given them to do the good works intended for them in Christ (Eph 2:10) will recieve salvation not as their wage (i.e. they are 'owed' it—Rom 4:4), but as their reward—simply as the promised outcome to obeying His commandments.
In order to see a contradiction, you would need to ignore that he says that salvation is not the result or wage of works, which Romans doesn't claim it is.
In other words, persisistence to the end in the doing good will result in salvation, but not because the works have earned it.
Cosnider an analogy: if I owned a vineyard and paid someone a huge bonus for their hard work, it doesn't mean their work was proportional to that bonus, but that since they obeyed, I am choosing to give them that which I promised to those who did what I asked without complaining: they ought to do so anyway, but I am rewarding them according to my own promise, freely.