We calculate the long-distance effect generated by the four-quark operators with $c$-quarks in the $Bto K^{(*)} ell^+ell^-$ decays. At the lepton-pair invariant masses far below the $bar{c}c$-threshold, $q^2ll 4m_c^2$, we use OPE near the light-cone. The nonfactorizable soft-gluon emission from $c$-quarks is cast in the form of a nonlocal effective operator. The $Bto K^{(*)}$ matrix elements of this operator are calculated from the QCD light-cone sum rules with the $B$-meson distribution amplitudes. As a byproduct, we also predict the charm-loop contribution to $Bto K^*gamma$ beyond the local-operator approximation. To describe the charm-loop effect at large $q^2$, we employ the hadronic dispersion relation with $psi=J/psi,psi (2S), ...$ contributions, where the measured $ Bto K^{(*)}psi $ amplitudes are used as inputs. Matching this relation to the result of QCD calculation reveals a destructive interference between the $J/psi$ and $psi(2S)$ contributions. The resulting charm-loop effect is represented as a $q^2$-dependent correction $Delta C_9(q^2)$ to the Wilson coefficient $C_9$. Within uncertainties of our calculation, at $q^2$ below the charmonium region the predicted ratio $Delta C_9(q^2)/C_9$ is $leq 5% $ for $Bto K ell^+ell^-$, but can reach as much as 20% for $Bto K^*ell^+ell^-$, the difference being mainly caused by the soft-gluon contribution.