Charge detection with nanomechanical resonators