There's an easier fix to this than restoring your iPhone.
- Go to settings --> iTunes & App Store
- Click on your Apple ID up top and choose Sign Out
- Re-login to your Apple ID on that screen
- Go back to iTunes Music Library and turn it back on
If you still get the error, try repeating the steps. Most times it fixes it for me on the first try though.
