Supersymmetric gauge theories from D3-branes on singularities