"To what extent have the poor performance of stock markets, the weakness of the US dollar, and the continued rise in oil prices caused a rise in the gold price?"
There are links between each of the three factors you cite and the price of gold, which is currently at a record level. Essentially the focus of this question is the ailing US economy, which in turn has repercussions for practically all the other major industrialised economies.
A renewed fear of inflation produced a spate of interest rate increases in 2007, across the globe. There is an inverse relationship between interest rates and stock (bond) prices - hence a rise in interest rates produces a fall in stock prices. In the Us in particular, this was reinforced by growing pessimism about the future of the economy, with a dramatic slowdown in economic growth (fears of outright recession later in 2006), rising unemployment and a near-collapse of the housing market. In circumstances of such uncertainty, investors naturally turn to investments that are seen as rock solid, of which gold is the most obvious example.
The weakness of the US dollar reflects the US's growing current account deficit, in turn exacerbated by the slowdown in output growth (which affects exports adversely) and the high propensity to consume often cheaper manufactured goods from abroad. The US economy, being in an increasingly precarious state, has also encountered growing difficulty in attracting inward capital flows, putting further pressure on the dollar. The dollar has traditionally been a strong world currency, but continuing uncertainty over its future value has led speculators to move into other currencies (particularly the euro) but also precious metals such as gold.
The rise in oil prices, which have now reached over $100 a barrel (the US is a major importer) has had a disastrous effect on the US economy, and has contributed to all the problems outlined above - lower growth, higher unemployment, higher inflation and a worsening current account deficit.
In addition to these underlying factors, the 'credit crunch', which originated in the US in the summer of 2007, is also critical. The problem arose in the sub-prime market, where lenders increasingly advanced mortgage funds to risky borrowers, many of whom were always likely to default. The lenders in question tended to package these debts and sold them on to other banks and financial institutions. With the housing market in free fall in the second half of 2007, large numbers of borrowers predictably defaulted, leaving many banks short of liquidity. This in turn made banks increasingly unwilling to lend to each other, as they have done traditionally, the result of which was a drying up of funds for lending. This had an inevitable effect on the real economy, with businesses, already under pressure, finding it increasingly difficult to secure loans. This, together with the other factors identified above, added to the uncertainty, and prompted a rush by investors into gold.
Given the importance of the USA as a world trader and investor, there was bound to be a knock-on effect on other countries. In the UK, for example, the failure of Northern Rock can be traced directly to the same lending strategy that proved so disastrous in the US. Despite cuts in the Bank of England's base interest rate, UK financial institutions are now increasing their own lending rates and imposing much tougher conditions on borrowers too. The growth of the UK economy is slowing down - hence, just as in the USA, when a recession is feared, large numbers of investors and speculators jump into precious metals, which, given the limited supply, scarcely ever lose value. The process will continue, despite huge US cuts in interest rates in 2008, unless the huge stimulus package passed recently by Congress goes some way towards reviving the economy (particularly the housing market) and dispelling the current uncertainty.
I hope this is helpful.