Pregnant women could find it harder in future to obtain an abortion because of the growing number of doctors who are opposed to carrying out terminations.

A survey of medical students has found that almost half believe doctors should be allowed to refuse to perform any procedure to which they object on moral, cultural or religious grounds, such as prescribing contraception or treating someone who is drunk or high on drugs.

Abortion provoked the strongest feelings among the 733 medical students surveyed, according to the study in the Journal of Medical Ethics. "The survey revealed that almost a third of students would not perform an abortion for a congenitally malformed foetus after 24 weeks, a quarter would not perform an abortion for failed contraception before 24 weeks and a fifth would not perform an abortion on a minor who was the victim of rape," said researcher Dr Sophie Strickland.

"In light of increasing demand for abortions, these results may have implications for women's access to abortion services in the future," she added.

Concern about termination services is rising, with fewer doctors willing to perform the procedure, according to the Department of Health. The Royal College of Obstetricians and Gynaecologists has voiced concern about the "slow but growing problem of trainees opting out of training in the termination of pregnancy and is therefore concerned about the abortion service of the future".

Ann Furedi, chief executive of the British Pregnancy Advisory Service, said: "Abortion is taught increasingly infrequently in medical school, and students may not be required to engage much with the reasons why a woman may find herself with an unwanted pregnancy and the distress this may cause. All of us involved in women's reproductive healthcare need to ensure that young doctors understand why women need abortions, and that this is a profession to be proud of."

Some 45.2% of those surveyed believed doctors should have the right to refuse to treat someone when doing so clashed with their personal beliefs, but 40.6% disagreed. "Once qualified as doctors, if all these respondents acted on their conscience and refused to perform certain procedures, it may become impossible for conscientious objectors to be accommodated in medicine," said Strickland.

Backing for a doctor's right to refuse to perform any procedure was highest among Muslim medical students, at 76.2%. Some 54.5% of Jewish students also thought doctors should have the right to refuse, as did 51.2% of Protestants and 46.3% of Catholics.

Guidance drawn up by the General Medical Council (GMC), which regulates doctors, advises doctors to refer a patient to a colleague if they object to a certain procedure or treatment.

"However, we also make clear that doctors have an overriding duty to provide care for patients who are in need of medical treatment, whatever the cause of that medical need. It is not acceptable to opt out of treating a particular patient or group of patients because of personal beliefs or views about them, for example if they misuse drugs or alcohol," said Dr Peter Rubin, the GMC's chair.

The British Medical Association said that while doctors and medical students can refuse to participate in treatments they are uncomfortable with, patients must not be harmed or affected by their decision. They must also give patients enough information so they can seek treatment elsewhere within the NHS, according to a spokesman for the doctors' union's medical ethics committee.

The Department of Health said: "Patients' clinical needs always come first, and practising doctors understand this. It is unlawful to discriminate on the grounds of religion or belief and the law does not entitle people to apply such beliefs in a way which impinges upon other people, even if they claim that their religion or belief requires them to act in this way.

"All patients have a right to a comprehensive and fair NHS. The NHS constitution, white paper and the Equality Act provide the legal framework and principles that underpin the way the NHS should provide its services and support its staff."