How exactly does the black market affect a country's economy?
I think the question is extremely broad. The effects of drug dealing on the whole economy depend on many things, for example, on how strict is the country at enforcing the ban, how violent the drug dealers are, and what is done with the profits. The experiences in Mexico and Colombia, for example, are substantially different. While many drug lords have developed complete cities from the gains from trafficking, others have simply wasted it all. In most cases, the government is involved in the trafficking (via corruption) so it can have some positive effects in terms of govt budget, but if it becomes violent, the costs are clear. 

If there is any generality I would say that the combo of low cost and huge demand makes it really hard to prohibit. There are a few studies trying to measure the economic effect of the violence of drug dealing, but any empirical work is limited due to the lack of reliable data on basically every aspect of illegal markets.