Electromagnetic scattering by an arbitrary configuration of dielectric spheres