Python 2, <del>480 436</del> 386 bytes
===

<!-- language: lang-py -->

    exec u"""s=sorted;H=[];V=[]
    FRIinput():
     S=2*map(s,zip(*R))
     FiI0,1,2,3:
    	c=S[i][i/2];a,b=S[~i]
    	FeIs(H):
    	 C,(A,B)=e
    	 if a<C<b&A<c<B:e[:]=C,(A,c);H+=[C,(c,B)],;V+=[c,(a,C)],;a=C
    	V+=[c,(a,b)],;H,V=V,H
    print sum(a==A==(d,D)&c==C==(b,B)&B-b==D-d&{d<x<D&b<y<B Fx,yI[(o,p)[::r]FrI-1,1Fp,OI[V,H][r>0]FoIO]}=={0}Fb,aIH FB,AIH Fd,cIV FD,CIV)""".translate({70:u"for ",73:u" in ",38:u" and "})

Takes a list of coordinate pairs through STDIN in the format:

    [  [(x, y), (x, y)],  [(x, y), (x, y)],  ...  ]

and prints the result to STDOUT.

<br>
The actual program, after string replacement, is:

<!-- language: lang-py -->

    s=sorted;H=[];V=[]
    for R in input():
     S=2*map(s,zip(*R))
     for i in 0,1,2,3:
    	c=S[i][i/2];a,b=S[~i]
    	for e in s(H):
    	 C,(A,B)=e
    	 if a<C<b and A<c<B:e[:]=C,(A,c);H+=[C,(c,B)],;V+=[c,(a,C)],;a=C
    	V+=[c,(a,b)],;H,V=V,H
    print sum(a==A==(d,D) and c==C==(b,B) and B-b==D-d and {d<x<D and b<y<B for x,y in [(o,p)[::r]for r in -1,1for p,O in [V,H][r>0]for o in O]}=={0}for b,a in H for B,A in H for d,c in V for D,C in V)

Explanation
---

Instead of fiddling with complex polygons, this program deals with simple line segments.
For each input rectangle, we add each of its four edges to a collective segment list, individually.
Adding a segment to the list goes as follows:
we test each of the existing segments for intersection with the new segment;
if we find an intersection, we divide both segments at the point of intersection and continue.
To make things easier, we actually keep two separate segment lists: a horizonal one and a vertical one.
Since segments don't overlap, horizontal segments can only intersect vertical segments and vice versa.
Better yet, it means that all intersections (not considering the edges of the same rectangle) are "proper," i.e., we don't have T-shaped intersections, so "both sides" of each segment are truly divided.

Once we've constructed the segment list(s), we start counting squares.
For each combination of four segments (particularly, two horizontal segments and two vertical ones,) we test if they form a square.
Furthermore, we verify that no vertex lies within this square (which can happen if, for example, we have a small square inside a bigger one.)
This gives us the desired quantity. Note that even though the program tests each combination four times in different orders, the particular ordering of the segment coordinates guarantees that we count each square only once.