How do I reconcile the apparent contradiction of Vatican II and former teachings regarding salvation outside of the Catholic Church?
A literal understanding of being an official/external member of the Catholic Church as necessary for salvation is not the teaching of the Church. A priest, Fr. Leonard Feeney, preached that message and was excommunicated in 1953 for disobedience in refusing to come to Rome and explain his views. This error is now named after him and is commonly called Feeneyism or the Boston Heresy.
The Holy Office in 1949 wrote to Fr. Feeney and asked him to accept the Church's definition/understanding of the doctrine extra ecclesiam nulla salus:
Therefore, that one may obtain eternal salvation, it is not always required that he be incorporated into the Church actually as a member, but it is necessary that at least he be united to her by desire and longing.
However, this desire need not always be explicit, as it is in catechumens; but when a person is involved in invincible ignorance God accepts also an implicit desire, so called because it is included in that good disposition of soul whereby a person wishes his will to be conformed to the will of God.
This was no different from what Pope Pius IX said in his allocution Singulari Quadam in 1854:
It must, of course, be held as a matter of faith that outside the apostolic Roman Church no one can be saved, that the Church is the only ark of salvation, and that whoever does not enter it will perish in the flood. On the other hand, it must likewise be held as certain that those who live in ignorance of the true religion, if such ignorance be invincible, are not subject to any guilt in this matter before the eyes of the Lord. But then, who would dare to set limits to this ignorance, taking into consideration the natural differences of people, lands, native talents, and so many other factors?
Most people, however, fall into some in-between category that is often impossible for human judgment to conclude how culpable an individual is for his lack of formal membership in Christ’s Catholic Church. But we must always remember that the Catholic Church contains the fullness of Christ’s truth and what is necessary for salvation. Elements of that truth are found elsewhere, but its fullness can be found only in Catholicism. If someone, through no sinful fault, is not a formal member of the Catholic Church but adheres to the truth of Christ that he does know, he is considered to be in an imperfect communion with Christ’s Church.