Phase field model for dendritic growth with impurities