<PAGE>
                                                                   EXHIBIT 10.4


                         INVESTMENT MANAGEMENT AGREEMENT

AGREEMENT made this 1st day of August, 2002, by and between NUVEEN QUALITY
PREFERRED INCOME FUND 2, a Massachusetts business trust (the "Fund"), and NUVEEN
INSTITUTIONAL ADVISORY CORP., a Delaware corporation (the "Adviser").

                                   WITNESSETH
                                   ----------

In consideration of the mutual covenants hereinafter contained, it is hereby
agreed by and between the parties hereto as follows:

1. The Fund hereby employs the Adviser to act as the investment adviser for, and
to manage the investment and reinvestment of the assets of the Fund in
accordance with the Fund's investment objective and policies and limitations,
and to administer the Fund's affairs to the extent requested by and subject to
the supervision of the Board of Trustees of the Fund for the period and upon the
terms herein set forth. The investment of the Fund's assets shall be subject to
the Fund's policies, restrictions and limitations with respect to securities
investments as set forth in the Fund's then current registration statement under
the Investment Company Act of l940, and all applicable laws and the regulations
of the Securities and Exchange Commission relating to the management of
registered closed-end, non-diversified management investment companies.

The Adviser accepts such employment and agrees during such period to render such
services, to furnish office facilities and equipment and clerical, bookkeeping
and administrative services (other than such services, if any, provided by the
Fund's transfer agent) for the Fund, to permit any of its officers or employees
to serve without compensation as trustees or officers of the Fund if elected to
such positions, and to assume the obligations herein set forth for the
compensation herein provided. The Adviser shall, for all purposes herein
provided, be deemed to be an independent contractor and, unless otherwise
expressly provided or authorized, shall have no authority to act for nor
represent the Fund in any way, nor otherwise be deemed an agent of the Fund.

2. For the services and facilities described in Section l, the Fund will pay to
the Adviser, at the end of each calendar month, an investment management fee
computed by applying the following annual rate to the average total daily net
assets of the Fund:

           Rate                      Average Total Daily Net Assets/(1)/
           -----                     ---------------------------------
           .900%                     Up to $500 million
           .875%                     $500 to $1 billion
           .850%                     $1 billion to $1.5 billion
           .825%                     $1.5 billion to $2 billion
           .800%                     $2 billion and over

/(1)/Including net assets attributable to the Fund's Preferred Shares and the
principal amount of borrowings.

For the month and year in which this Agreement becomes effective, or terminates,
there shall be an appropriate proration on the basis of the number of days that
the Agreement shall have been


                                     Page 1
<PAGE>

in effect during the month and year, respectively. The services of the Adviser
to the Fund under this Agreement are not to be deemed exclusive, and the Adviser
shall be free to render similar services or other services to others so long as
its services hereunder are not impaired thereby.

3. The Adviser shall arrange for officers or employees of the Adviser to serve,
without compensation from the Fund, as trustees, officers or agents of the Fund,
if duly elected or appointed to such positions, and subject to their individual
consent and to any limitations imposed by law.

4. Subject to applicable statutes and regulations, it is understood that
officers, trustees, or agents of the Fund are, or may be, interested in the
Adviser as officers, directors, agents, shareholders or otherwise, and that the
officers, directors, shareholders and agents of the Adviser may be interested in
the Fund otherwise than as trustees, officers or agents.

5. The Adviser shall not be liable for any loss sustained by reason of the
purchase, sale or retention of any security, whether or not such purchase, sale
or retention shall have been based upon the investigation and research made by
any other individual, firm or corporation, if such recommendation shall have
been selected with due care and in good faith, except loss resulting from
willful misfeasance, bad faith, or gross negligence on the part of the Adviser
in the performance of its obligations and duties, or by reason of its reckless
disregard of its obligations and duties under this Agreement.

6. The Adviser currently manages other investment accounts and funds, including
those with investment objectives similar to the Fund, and reserves the right to
manage other such accounts and funds in the future. Securities considered as
investments for the Fund may also be appropriate for other investment accounts
and funds that may be managed by the Adviser. Subject to applicable laws and
regulations, the Adviser will attempt to allocate equitably portfolio
transactions among the portfolios of its other investment accounts and funds
purchasing securities whenever decisions are made to purchase or sell securities
by the Fund and one or more of such other accounts or funds simultaneously. In
making such allocations, the main factors to be considered by the Adviser will
be the respective investment objectives of the Fund and such other accounts and
funds, the relative size of portfolio holdings of the same or comparable
securities, the availability of cash for investment by the Fund and such other
accounts and funds, the size of investment commitments generally held by the
Fund and such accounts and funds, and the opinions of the persons responsible
for recommending investments to the Fund and such other accounts and funds.

7. This Agreement shall continue in effect until August l, 2003, unless and
until terminated by either party as hereinafter provided, and shall continue in
force from year to year thereafter, but only as long as such continuance is
specifically approved, at least annually, in the manner required by the
Investment Company Act of 1940.

     This Agreement shall automatically terminate in the event of its
assignment, and may be terminated at any time without the payment of any penalty
by the Fund or by the Adviser upon no less than sixty (60) days' written notice
to the other party. The Fund may effect termination by action of the Board of
Trustees or by vote of a majority of the outstanding voting securities of


                                     Page 2
<PAGE>


the Fund, accompanied by appropriate notice.

     This Agreement may be terminated, at any time, without the payment of any
penalty, by the Board of Trustees of the Fund, or by vote of a majority of the
outstanding voting securities of the Fund, in the event that it shall have been
established by a court of competent jurisdiction that the Adviser, or any
officer or director of the Adviser, has taken any action which results in a
breach of the covenants of the Adviser set forth herein.

     Termination of this Agreement shall not affect the right of the Adviser to
receive payments on any unpaid balance of the compensation, described in Section
2, earned prior to such termination.

8. If any provision of this Agreement shall be held or made invalid by a court
decision, statute, rule, or otherwise, the remainder shall not be thereby
affected.

9. Any notice under this Agreement shall be in writing, addressed and delivered
or mailed, postage prepaid, to the other party at such address as such other
party may designate for receipt of such notice.


                                     Page 3
<PAGE>

10. The Fund's Declaration of Trust is on file with the Secretary of the
Commonwealth of Massachusetts. This Agreement is executed on behalf of the Fund
by the Fund's officers as officers and not individually and the obligations
imposed upon the Fund by this Agreement are not binding upon any of the Fund's
Trustees, officers or shareholders individually but are binding only upon the
assets and property of the Fund.

11. This Agreement shall be construed in accordance with applicable federal law
and (except as to Section 10 hereof which shall be construed in accordance with
the laws of Massachusetts) the laws of the State of Illinois.

         IN WITNESS WHEREOF, the Fund and the Adviser have caused this Agreement
to be executed on the day and year above written.


                                        NUVEEN QUALITY PREFERRED INCOME FUND 2



                                           by:   /s/ Gifford R. Zimmerman
                                               ---------------------------------
                                                        Vice President



Attest:  /s/ Virginia L. O'Neal
        ----------------------------
            Assistant Secretary


                                        NUVEEN INSTITUTIONAL ADVISORY CORP.



                                           by:  /s/ William M. Fitzgerald
                                              ----------------------------------
                                                      Managing Director



Attest:  /s/ Jessica R. Droeger
        ----------------------------
            Assistant Secretary




                                     Page 4