Rather than complicated, that sum would be quite simple if it were correct. It doesn't depend on the structure of the original graph, only on the numbers of vertices and edges. It is also wrong. Consider $G$, a complete graph on $4$ vertices plus $2$ isolated vertices, and $H$, a hexagon. Both have $6$ vertices and $6$ edges. However, there is no way for $G'$ to have fewer than $3$ vertices, while $H'$ can have $1$ or $2$. Any correct formula for the probability that the contracted graph has $2$ vertices must depend on properties of the graph other than just the number of vertices and edges. Here is a more subtle approach which also doesn't work (exactly): Order the vertices, and for each vertex $v$, consider the number of vertices of lower index which are adjacent to $v$, $d^-(v)$. For $v$ to be the least index in its equivalence class (a vertex in $G'$), it is necessary that none of these edges are contracted. However, this is not sufficient, since it could be that $(v_2,v_3)$ and $(v_3,v_1)$ are contracted even though $(v2_,v_1)$ is not. However, for any ordering, you at least get the bound $$E|V(G')| \le \sum_v (1-p)^{d^-(v)}.$$