Officials in the European Union reached a deal Friday on a sweeping bill aiming to regulate artificial intelligence in what is one of the world’s first major, comprehensive attempts to regulate the technology.