The phrase "darkest Africa" appears in print at least as early as 1852. From "Thoughts on Man in His Relations to God and to External Nature" (1852):
No cries are heard of anger and despair; / But one deep, calm, long-pealing hymn of joy, / From earth to heaven ascending;—peace and love / Wrapp'd as an atmosphere around the globe; / Mankind as a brotherhood. Truth reigns, and now / Dark places dark no more, no more are filled / With horrid cruelty. Now,—purest light / Pour'd forth profuse on India's populous plains, / And darkest Africa,—no beat of drums / Announces death of immolated slave,— / But the sweet, solemn sound, at eve or morn, / Of bells inviting to the house of prayer, / Is heard instead o'er all the Niger's plain.
In this poem, the darkness of "darkest Africa" seems to refer to the darkness of being "filled with horrid cruelty"—presumably owing to the related darkness of lacking knowledge of Christianity.
A somewhat different notion seems to infuse the phrases "the darkest spots in Africa" and "the darkest places of Africa," in "West Africa," in The Fifty-Ninth Report of the British and Foreign Bible Society (1863):
Some letters received from Mr. Zimmerman refer to the success of Missionary operations, while conveying information as to the work of translation. Amidst many causes of sadness, joy is inspired, because Word of God prospers in its course even in the darkest spots of Africa. The increased desire for the knowledge of Divine Truth is the best recompense your Committee can receive, for providing the Scriptures on behalf of the oppressed tribes of Africa.
...
'So, everywhere the Word of God is advancing to the darkest places of Africa. The dead bones begin to move. May the Lord soon send His Spirit from above, to give them life!'
Here, the "darkest" locales in Africa seem to be the regions that are most remote from the missionaries—not necessarily the ones that are most lawless or profane.
Henry Stanley may not aware of the 1852 poem. In any event, his use of "darkest Africa" to signify the least explored (by Europeans) areas of the African continent—in his hugely successful book In Darkest Africa: or, The Quest, Rescue, and Retreat of Emin Governor of Equatoria (1890)—seems to have led directly to popularization of the phrase. A Google Books search turns up dozens of references to Stanley's book and to "darkest Africa" as a descriptive term in publications within just a few years of 1890—most notably in missionary periodicals, where, again, darkness neatly conflates geographical obscurity and spiritual unenlightenment. Such was the fame of Stanley's book that publishers soon turned out such copycat (or parodic) titles as A New Light Thrown Across the Keep It Quite Darkest Africa (1890), In Darkest England, and the Way Out (1890), and Darkest India (1891). The latter two books, written by William Booth and by Frederick Booth-Tucker of the Salvation Army, refer explicitly to spiritual darkness.
'The Dark Continent' as a possible antecedent to 'darkest Africa'
Stanley's formulation of "darkest Africa" may have been a play on his earlier use of "the Dark Continent" in Through the Dark Continent; or, The Sources of the Nile, Around the Great Lakes of Equatorial Africa, and Down the Livingstone River to the Atlantic Ocean (1878).
The term "Dark Continent" in reference to Africa was already in use long before that date, however. For example, from "The Heart of Africa" in The Month and Catholic Review (July 1874):
The dark ages, according to the well known saying, were so called, because they were dark to us: and Africa might well have been called the Dark Continent for a similar reason. The maps used to represent it as slightly inhabited—so far as it was to be supposed that where there were names of towns and ports there must be human habitations—along parts of its coasts, though here there were large gaps, in the valley of the Nile, Nubia, at its southern tip. occupied by the Cape Colony, and few other comparatively small regions besides. It had its two famous rivers [presumably the Nile and the Niger], the sources of which were unknown, but which might as well have been supposed to be contiguous to each other in the "Mountains of the Moon." Something was known of a few of the kingdoms of the interior. But the greater part of the continent was supposed to be desert, or something like desert, roamed over by wild animals. If inhabited by men at all, they were men practically of another world, of whom—except to use them as slaves—the inhabitants of Europe, Asia, or America, knew or cared little.
In fact, "dark continent" appears in publications at least as early as 1828. From "Africa," in The African Repository, and Colonial Journal (1828):
Africa, notwithstanding, is pronounced by common consent, the birthplace and cradle of civilization, as well as of the arts and sciences. In one corner of that dark continent was kindled the light, which was destined to blaze so conspicuously in Greece and Rome, and which was to attain, under the auspices of Christianity, in Europe and America, the full splendor of its meridian brightness.
From Archibald Alexander, "Introductory Discourse," in A Memoir of the Rev. Joseph W. Barr: Late Missionary Under the Direction of the Western Foreign Missionary Society (1833):
God seems to have raised up this colony [Liberia], as the first step toward the civilization and Christianization of benighted Africa. ... However injurious the slave-trade has been, to a large portion of this country; and however unjust to the oppressed Africans—of both which every impartial man must be deeply convinced—yet he who takes a comprehensive view of the whole subject, must be satisfied, that ultimate good will be the result of bringing the African race to America. Already, multitudes have received the blessings of the gospel, who, if they had remained, or been born in Africa, must have perished in their idolatry. And if, by the agency of the colonization society, that dark continent should become illumined with the rays of gospel light, how grand will be the result?
From "Summary of Religious Intelligence," in Evangelical Magazine (September 1833):
It is a fact that one language, (the Betjouana,) prevails over a very great part of South Africa.—Another language, (the Berbee,) stretches along the whole northern coast. This will greatly facilitate the introduction of the Bible to those people. Thus, as time advances, more missions will be established, and a line of light-houses, as it were, will be strung around on the borders of that dark continent. The work seems to be well commenced. At Egypt, Abyssinia, Madagascar, over the whole Southern extreme, at Liberia and Sierra Leone, are found the heralds of the cross. The light will soon penetrate the interior.
From John Breckenridge, "Young Men's Colonization Society" (October 15, 1835) in Hazard's Register of Pennsylvania (October 31, 1835):
The principles upon which the [Bassa Cove, Liberia] colony was founded are such as were best adapted to promote alike the highest interests of the emigrants and of the dark continent to which they were sent: being those of temperance, peace and christian order.
From John Breckenridge, "An Address Delivered July 15, 1835, Before the Eucleian and Philomathean Societies of the University of the City of New-York" (1836):
But of all nations, we have most injured Africa ; and of all nations we possess the most extraordinary resources to civilize, and evangelize that dark continent. Our facilities are exceeded only by our obligations.
From Frederick Freeman, Yaradee: A Plea for Africa, Being Familiar Conversations on the Subject of Slavery and Colonization (1836):
The treatment which they ["the Africans"] have received, it is said, had caused them to identify Christianity with perfidy and cruelty, until recent efforts were made to colonize Africa with free men, and to civilize and christianize that dark continent by means of colonization.
...
The object [of African colonization] is thought to have powerful claims to our best and warmest wishes, and untiring efforts, whether we consult the best interests of the free blacks, the slaves, the whites, or the many millions scattered over the dark continent of Africa.
From Stephen Kay's "travels and researches," quoted in James Paulding, Slavery in the United States (1836):
Every page of African history renders it abundantly evident, that misery and destruction are in all the ways of fallen man, and that to him the way of peace is altogether unknown. As in the western, so also in the southern division of this dark continent, its numerous tribes and clans are continually feeding the vengeful flame.
From "The Twenty-First Annual Report of the American Society for the Colonizing the Free People of Color of the United States, with the Proceedings of the Annual Meeting, December 13, 1837" (1838):
The mighty work has begun—the Wesleyan Missionaries have kindled a fire upon the Southern coast, and have pressed the cup[ of salvation sccessfully to the parched lips of the Hottentots, and the Christians of the United States have struck a light upon the Western coast, by means of the Colonization Societies—and at no distant day, shall those kindled fires commingle and extend their radiation into the interior of that dark continent ; and Africa, emancipated and disenthralled, shall stand forth a monument, alike of the wisdom of the Colonization enterprise, and of the benevolence and efficiency of Christian Missionary labor.
From Joseph Eisdell, A Treatise on the Industry of Nations; or, The Principles of National Economy, and Taxation, volume 1 (1839):
The boundaries of the "republic of letters" have already been extended from Europe to America, and a new continent has thus been acquired for it. Asia and Africa, with the ancient seats of learning and refinement, remain to be subdued or reclaimed and added to its dominions. Civilization has commenced her onward march ; she is no longer quiet. India lies open and prostrate before her. Africa, the strong-hold of barbarism, is no longer inaccessible. At the two extremities, and against the centre, of that dark continent, civilization, under the wings of the two most polished nations of the earth, has planted her foot, and began to diffuse her light ; can we doubt of her progress?
And from M.B. Hope, "Address to the Clergy of all denominations in the State of Pennsylvania" (June 15, 1839), reprinted in The Colonization Herald and General Register (June 1839):
The cause of colonization [of Liberia] is linked in with more important objects, and bears upon more important interests, than any other which claims the attention of the benevolent. It has for its object to elevate and bless the free colored population of our country—to ransom from perpetual slavery (hundreds of individuals and families) those who otherwise must descend in bondage to the grave,—to harmonize the conflicting interests of the North and the South, and quiet the agitations which convulse our land, by removing the evils which gave them birth,—to banish from the earth the iniquitous and accursed slave trade, and to diffuse the blessings of civilization and christianity throughout the dark continent of Africa.
Emergence of 'The Dark Continent' as a quasi-proper name
Significantly, of the ten instances of "dark continent" from the period 1828–1839 cited above in reference to Africa, only Breckenridge's 1835 announcement, Freeman's 1836 book, and Hope's 1839 article use the formulation "the dark continent [of Africa]"; the other seven refer rather to "that dark continent" or (in one case) "this dark continent." Moreover, none of the cited instances refers to "the Dark Continent" as a sobriquet or quasi-proper name.
Throughout the 1840s and 1850s, the phrase "the dark continent of Africa" appears with some frequency. And by 1862 "the dark Continent" had begun to appear in texts in quotation marks, albeit not as a full-fledged proper name. From a letter dated January 14, 1862, and posted from the Camaroons Mountains, from British consul Richard Burton to Earl Russell, reprinted in Accounts and Papers of the House of Commons, volume 71 (1863):
And besides being an adit to trade, the Niger is destined to become the highroad of Central African exploration, and the means, if there be any, of diffusing light throughout the interior of the "dark Continent."
Richard Burton, Abeouta and the Camaroons Mountains: An Exploration, volume 1 (1863) similarly puts "the dark continent" in quotation marks—without initial-capping the (entire) phrase:
A writer in the 'Times' has lately given to my last African explorations in Harar and the Lake Regions the title of reconnaissances. C'est bien le mot. I accept it as the best description of my scanty contributions towards the extension of geographical knowledge of the 'dark continent,' and accordingly it is prefixed to the Second Part of this work.
...
By a collection from the works of different travellers in the remotest parts of the dark Continent, it would methinks be easy to prove a close connection in ancient times between nations and peoples now ignoring one another's existence.
Nevertheless, the earliest instance I have found of "the Dark Continent" treated as a proper noun is from 1863. From "A F.R.G.S." (presumably short for "Fellow of the Royal Geographical Society"), Wanderings in West Africa from Liverpool to Fernando Po (1863):
The history of the Ashantee wars, which began in 1807, is that of the African coast generally. In these lands there are two great axioms of native policy. The first is never admit strangers to the interior for trade, which it is the interest of maritime tribes to monopolize, and they live in idleness at the expense of the "Bushmen," or people of the interior. For this point, which is first in life to them, they will fight to the last, and hence the main difficulty of opening up the "Dark Continent."
...
The rite [circumcision] is called Keteafo, or shortening. It is practised by both Gá and Adanme tribes, and is in the keep of a certain family, though not directly connected with religion. The boys—not the girls, as some authors represent—are circumcised about 13 years of age. The missionaries believe this to point out a Hebrew or Moslem origin; I think not. They should bear in mind that the Jews derived the rite from Egypt, that is to say Africa, where it had been used for ages immemorial, and that in the very depths of the Dark Continent, where Jew or Arab never penetrated, it is practised under a variety of modifications.
Other dark continents
Notably, one fairly early source applies the phrase "dark continent" indifferently to both Africa and Asia. From "The Second Annual Essay of the Committee on Foreign Missions: Read Before the Society of the Theological Seminary at Princeton, New Jersey, January 1st, 1833" (1833):
Suppose as a test of your views, you had been born and brought up among the idolatrous, degraded, and perishing population, of the dark continent of Asia, or Africa; but by some wonderful change of circumstances you had been brought to a knowledge of Jesus; with your present views, feelings and sympathies, could you ever have dreamed of coming to America to labour for Christ? And now is not your duty to preach to the heathen, just as imperative as though this had been literally the case.A voyage of a few months will place you on those same benighted shores, and amidst that same degraded, dying population.
Another applies it to India. From "Communications from the Missions: India Missions," in The Missionary Chronicle: Containing the Proceedings of the Board of Foreign Missions of the Presbyterian Church (December 1839):
I would therefore indulge the hope that through our weak and unworthy instrumentality [as Christian missionaries in Saharunpur, India] some good has been accomplished in the name of the Lord Jesus, that the bread cast on the waters, will be found after many days, that the precious truth which has been dispensed will be carried to different parts of this dark continent, and there, in the quietness of the closet, be read by some to whom the Holy Spirit will make it the wisdom of God, and the power of God to salvation.
A third applies it to Catholic Europe. From "The Library," in The Sunday School Magazine (1846):
The Continental Echo. London: Snow. A monthly periodical, giving a digest of the state and progress of Protestant principles on the dark Continent of European idolatry. We heartily wish this publication could be seen in every Sunday school.
And a fourth to South America. From Report of the British and Foreign Bible Society (1858):
Nor should the fact that the Word of God has been printed, as well as circulated, by your Society in South America, be unnoticed. The partial exploration of that dark continent has revealed the necessity for the distribution of the Scriptures,—a necessity, your Committee feel, not only manifested by the exploration of a dark continent, but of a dark world.
In a somewhat less religious vein, an instance of "the dark Continent of Europe" appears in "The Spanish Revolution," in The London Review (November 1, 1809):
It was not for the soil, or for the cities and forts, that Portugal was valued, but for the human feeling which was there ; for the rights of human nature which might be there conspicuously asserted ; for a triumph over injustice and oppression there to be atchieved, which could neither be concealed nor disguised, and which should penetrate the darkest corner of the dark Continent of Europe by its splendour.
These are not the only nineteenth-century instances where geographical areas other than Africa are identified as "dark continents." However, Africa was, from the outset, the area that most commonly received this appellation.
Conclusions
The sources I have cited in this answer point to two main understandings of "the dark continent" and, subsequently, "darkest Africa." One is a chiefly secular understanding compounded of notions of region that is remote, unexplored, and largely unknown. The "darkness" thus refers to the lack of illumination about the place among Europeans and other Westerners—not to some darkness attributed to the understanding of the people of Africa.
The other is a zealously religious understanding, according to which the peoples of the continent are living and dying in the darkness of heathenism because they have not been enlightened by exposure to the proseletyzers' preferred strain of Christianity. Both understandings received considerable ink through the decades from the 1830s onward—the former primarily from explorers, scientists, and government officials, and the latter mainly from missionary societies. "The Dark Continent" seems to have been a particular favorite of the religious tracts, while "darkest Africa" seems to have had more appeal to explorers. Still, both camps used both terms, at least through the early decades of the twentieth century.
In more recent times, use of "dark continent" or "darkest Africa" to indicate a region of souls in grave peril has dropped off considerably (as, with the emergence of increasingly precise geographical mapping, has its use to indicate a little-known area). Still, the implication that Africa is a benighted region in need of salvation from better-informed Westerners may lurk at the periphery of both terms, and people on the continent might very reasonably take offense at the patronizing attitude that such an implication suggests.
Beyond that, I see no evidence in the sources I consulted that "the Dark Continent" or "darkest Africa" was, in its earliest occurrences, ever explicitly intended as a reference to the skin color of African people. Here again, however, the details of historical usage may not provide a green light for offense-free current usage: just as the question poster expresses uncertainty about whether "darkest Africa" refers "to the skin colour of the people," so others might entertain the same question—or they might suppose that a speaker or writer using the phrase intends it in that way. For these reasons, "the Dark Continent" and "darkest Africa" are probably best consigned to the museum of antiquities, side by side with the spinning wheel, the bronze axe, and the works of Friedrich Engels.