Charging in a dusty plasma