Adding a electrical outlet in a closet for wireless router
I don't think it's legal to power an outlet that's not in the kitchen off of one of the 2 required kitchen branch circuits (i.e. counter outlets). I think it would be OK to tap off of the un-switched side of a light circuit for the kitchen.

Since you have access through the attic, is there another general purpose branch circuit (that is non-kitchen) that you can tap into for the closet outlet?

There may be exceptions to the "kitchen branch circuit" restriction in the code that I'm not aware of that would allow you to do what you want.