A model of many globally coupled phase oscillators is studied by analytical and numerical methods. Each oscillator is coupled to all the other oscillators via a global driving force that takes the form tsumj g(φj), where g(φj) is a periodic function of the jth phase. The spatiotemporal properties of the attractors in various regions of parameter space are analyzed. In addition to simple spatially uniform fixed points and limit cycles, the system also exhibits spatially nonuniform attractors of three kinds. First, there are cluster states in which the system breaks into a few macroscopically big clusters, each of which is fully synchronized. Second, there is a stationary state with full frequency locking but no phase locking. The distribution of phases is stationary in time. Third, in an extremely narrow regime of parameters, a nonperiodic attractor exists. It is found that the cluster state is stable to the addition of weak stochastic noise. Increasing the level of noise beyond a critical value generates a continuous transition to a stationary ergodic state. In the special case where the nonlinearities in the dynamics involve only first harmonics, marginal states are observed, characterized by a continuum of marginally stable limit trajectories. These states are unstable under the introduction of noise.