There Will Be Dragons (2006) by John Ringo. It's the first book in the The Council Wars Series.
Plot summary from Wikipedia:
The series is set several thousand years in the future, in a society with advanced nanotechnology, teleportation, and other technologies which effectively are magical in the sense of Clarke's law made real, all controlled and coordinated by an artificial intelligence called Mother. Initially the world is a near Eden. War has been gone for millennia. The most aggressive, curious or adventurous humans have left Earth to explore space or terraform new worlds. The abundant power and technology allows long lives, powerful genetic engineering that includes the ability to turn into a merman or dolphin, the ability to have homes on mountain tops in the Himalayas or in deep volcanos, and free flight. Despite—or perhaps because of—an idyllic world, technology is stagnant, no great art has been produced in generations, and the human population is dropping slowly.
There are elves and dragons as in many fantasy novels. But the elves are the results of long-ago military genetic engineering programs and the dragons are genetically engineered sentients, originally designed by Disney.
Mother, who controls all the systems on Earth, as well as in near-Earth space and the Wolf 359 colonization project, is controlled by a Council of thirteen Key Holders who can change system directives and, if unanimous, change even her kernel-level programming. The Council has split into two philosophical factions, and is in a battle for whose ideals will dominate the future of the human race. When one of the Council members dies without a clear successor to their Key, the faction split becomes numerically balanced. That faction split leads to war: something humans have not had for over a millennium. The two factions split into open war only after the faction advocating extensive changes to society to reverse the decline in population fails to persuade the rest of the council and resorts to violence.
In the struggle for power, Mother's protocols forces her to split the available power between the voting members of the Council Members. This results in her being forced to cut off all the power to everyone else, including all the computer-controlled nanotech that have made their lives of leisure possible. This includes explosives as well as any new power sources that may come online. Because of the protocols that are defined in her kernel-level code, Mother simply siphons off any energy above a certain level, such as an explosion, high-pressure gas, or a new hydroelectric dam etc. The result: Humanity plunges immediately from utopia to the Dark Ages. This event is known as "The Fall." The series follows the resultant chaos and destruction that follows, and the war itself. The war ends up being fought on two planes; not just with advanced technology, but with swords, cavalry, and legions.
You can read a preview of the book here.