We investigated the lamellar orientation in thin films of a diblock copolymer P(S-b-MMA), under competing effects of surface interactions and an electric field applied perpendicular to the substrate. The surface effects tend to align the lamellae parallel to the substrate while the electric field tends to align the lamellae perpendicular to the substrate. Using neutron reflectivity, neutron diffuse scattering, and neutron small-angle scattering, we achieved a quantitative analysis of the internal structure of the films. Film thickness was found to play a non-trivial role in determining the structure of the films. A complete alignment by the surface effects was observed in the thinner films by annealing. The parallel orientation remains stable even if an electric field as strong as 40V/µm is applied. In the thicker films, a mixed orientation with boundary layers parallel and the central part partially perpendicular to the substrate was observed after annealing. The mixed orientation becomes unstable under a small compressive stress, and will be converted into a completely parallel orientation. The parallel orientation induced by the compressive stress remains stable as long as the electric field is weaker than several ten V/µm. Only a field of about 40V/µm is able to stabilize the above mentioned mixed orientation. A fully perpendicular orientation was never observed in our experiments. Diffuse scattering shows a mosaic structure in the absence of an electric field, whose mosaicity will be increased by the torque exerted by an electric field. The lateral correlation length of the lamellar domains is estimated as 1-2µm. Limited by the small qx-range we have used, a clear statement on the existence of the electric-field-induced structural undulations predicted by the Onuki's theory cannot be made from our experiments.