Mette Frederiksen, who has led the country since 2019, was “beaten,” her office said. The police said an arrest had been made, but a motive is unclear.