A new multiscale formulation for the electromechanical behavior of nanomaterials