According to the ingame stats menu, Dexterity is defined as
"Dexterity affects the speed and quality of your sword work. Your sword cuts will do more damage, your attacks and blocks will be faster."
The Dexterity stat appears to increase when using weapons that have a higher ratio of cutting damage versus blunt damage. For instance, a Katana will be much better at raising Dexterity than a Jitte (which lacks cutting damage altogether) or Naginata (which has a lower ratio of cutting damage to blunt damage).
A common misconception is that heavier weapons contribute less to dexterity, but that is simply because blunt weapons tend to be heavier. The Staff, with its low weight but high blunt damage, is poor at raising both Dexterity (because of its blunt damage) and Strength (because of its low weight, since strength DOES rely on weapon weight).
Dexterity is raised per-hit in combat, rather than by damage. Using a poor-quality weapon that strikes quickly (a junk Wakizashi, for example), will raise Dexterity faster, since more hits are required to defeat an enemy.