It's difficult to say. We can say with certainty that the Holocaust would have had a much smaller death toll had it not been for the German invasions of Western and Eastern Europe. The majority of people killed in the Holocaust came from Poland, Russia, the Ukraine, and other countries conquered by Germany. And many camps, like Auschwitz and Treblinka were built outside of German territory.
Whether or not the Holocaust was a planned or spontaneous event remains a subject of serious contention between the Intentionalist and the Functionalist schools of thought. Intentionalists see the "Final Solution" as a pre-planned event the Nazis intended to carry out by the 1930s. The early killings of Jews at places like Babi Yar in 1941 lend some credence to this belief.
Functionalists see the Holocaust as a reactionary event. As the Germans conquered new countries, they had to deal with the "Jewish Question." What was to be done with Polish, Russian, French, and Ukranian Jews? Should they be sterilized, ghettoized, forced to work, or exterminated? The transcripts of the 1942 Wannsee Conference give some insight into the Nazi dilemma and the beginnings of the industrial extermination of Jews.
In other words, its more likely that Nazi conquest enabled the Holocaust, rather than anti-Jewish prejudice motivate Nazi conquest.
The fact that there was a war on allowed the nazis to go much further in their "solution to the Jewish problem" then they would otherwise have been able to. For one thing, they wouldn't have held the same number of Jews in their sway, and for another, the death camps couldn't possibly have been operated in Germany, where such a barbaric process would have been unacceptable to public opinion (witness the vigorous church protests against the "euthanasia" of the disabled which forced a halt to that programme). Instead, the death camps were located in remote and sparsely inhabited corners of Poland. The nazi leadership were well aware of the need for secrecy, which is why they used code words in all their written communication about the extermination of the Jews. Even the use of such code words as "Sonderbehandlung" (special treatment) and "Gesamtlösung" (comprehensive solution) were banned by order of Hitler in 1943 and henceforth the killings could only be referred to as "resettled in the East" or "evacuated".
All of this is reflected in this highly revealing entry in the diary of Goebbels dated March 27, 1942. Clarification added by me in square brackets and bolding mine.
Beginning with Lublin, the Jews in the General Government [occupied Poland] are now being evacuated eastward [killed]. The procedure is a pretty barbaric one and not to be described here more definitely. Not much will remain of the Jews. On the whole it can be said that about 60 per cent of them will have to be liquidated whereas only about 40 per cent can be used for forced labor. The former Gauleiter of Vienna [Globocnik], who is to carry this measure through, is doing it with considerable circumspection and according to a method that does not attract too much attention. A judgment is being visited upon the Jews that, while barbaric, is fully deserved by them. The prophesy which the Fuehrer made about them for having brought on a new world war is beginning to come true in a most terrible manner. One must not be sentimental in these matters. If we did not fight the Jews, they would destroy us. It's a life-and-death struggle between the Aryan race and the Jewish bacillus. No other government and no other regime would have the strength for such a global solution of this question. Here, too, the Fuehrer is the undismayed champion of a radical solution necessitated by conditions and therefore inexorable. Fortunately a whole series of possibilities presents itself for us in wartime that would be denied us in peacetime. We shall have to profit by this.