Nigeria is set to pass a law that would place it among the first African countries to regulate artificial intelligence, tightening oversight of one of the continent’s fastest-growing digital markets after years of largely unchecked expansion by global technology firms.